﻿using System;

class FillNSizedMatrix

            // Write a program that fills and prints a matrix of size (n, n)
{
    static void Main()
    {
        Console.Write("Enter the size 'N': ");
        int sizeN = int.Parse(Console.ReadLine());
        int[,] matrix = new int[sizeN, sizeN];

        for (int row = 0; row < matrix.GetLength(0); row++)
        {
            for (int col = 0; col < matrix.GetLength(0); col++)
            {
                matrix[row, col] = 1 + row + col * sizeN;
            }
        }
        for (int row = 0; row < matrix.GetLength(0); row++)
        {
            for (int col = 0; col < matrix.GetLength(0); col++)
            {
                Console.Write("{0,4}", matrix[row, col]);
            }
            Console.WriteLine();
        }
    }
}

